import { Navigate } from 'react-router-dom'
import auth from '../store/auth'
import user from '../store/user'
import { Button, Container } from 'react-bootstrap'
import { observer } from 'mobx-react-lite'

export const UserPage = observer(() => {
    if (!auth.isLogIn) return <Navigate to='/home' />
    return (
        <>
            <Container>
                ID: {user.id}
                <br />
                <Button variant='dark' onClick={() => auth.LogOut()}>
                    Выйти
                </Button>
            </Container>
        </>
    )
})
